package com.raymond.config.exception;

import lombok.Data;

import static com.raymond.entity.commons.DtoResult.STATUS_CODE_FAILED;

/**
 * desc-自定义业务异常
 *
 * @author houmenghe
 * @date 2025/04/20 22:44
 **/
@Data
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = -2054023852066901556L;

    private int errorCode;

    public BusinessException() {
    }

    public BusinessException(String message) {
        super(message);
        this.errorCode = STATUS_CODE_FAILED;
    }

    public BusinessException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public BusinessException(Throwable e) {
        super(e);
    }
}